package com.prim.threadpool;

public class TestThreadPool {
    public static void main(String[] args) throws InterruptedException {
        FixedSizeThreadPool pool = new FixedSizeThreadPool(3, 6);
        for (int i = 0; i < 6; i++) {
            pool.execute(new Runnable() {
                @Override
                public void run() {
                    try {
                        System.out.println("任务正在执行中....");
                        Thread.sleep(2500);
                        System.out.println("任务执行结束");
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            });
        }
        pool.shutdown();
    }
}
